home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Netware Super Library
/
Netware Super Library.iso
/
zipfiles
/
p2z
/
segue.exe
/
BDSUPLST.PRG
< prev
next >
Wrap
Text File
|
1991-07-25
|
5KB
|
155 lines
*.............................................................................
* Program Name: BDSUPLST.PRG Copyright: HRF Associates, Inc.
* Date Created: 07/24/91 Language: Clipper
* Time Created: 03:32:51 Author: Bob Fogle (203) 866-4324
*.............................................................................
*
* Supplemental SEGUE function for listing objects in the bindery
* with Supervisor equivalences.
*
FUNCTION SUPLST_(obtp, obnm, aobnm, aobtp)
*Purpose : To list objects in the bindery with Supervisor equivalences.
*Usage : SUPLST_(<expN1>, <expC2> [,<expC3>] [,<expC4>])
* :
* Where : <expN1> = Search Object Type
* : <expC2> = Search Object Name. (1..47) [No spaces)
* : <expC3> = Array Name for Returned object Names
* : <expC4> = Array Name for Returned object Types
* :
*On Error: <expN>, where:
* : 0 if Successful.
* : - 101..-103 if Invalid Parameter.
* : The last two digits indicates which parameter was invalid.
* : - 150 if Server Out Of Memory.
* : - 239 if Invalid Name.
* : - 252 if No Such Object
* : - 254 if Server Bindery Locked.
* : - 255 if Bindery Failure.
* :
* NOTES : The Search User Name may contain wildcard specifiers.
* :
*Found in: BDUSRLST.PRG
* :
LOCAL mobnm, exitflag,mpassbg,mpassen,pnam :="SECURITY_EQUALS"
PRIVATE rtn, rtn1, aobid[0], arobid[0], arobnm[0], arobtp[0], arprvl[0]
* Check to make sure passed variable types are correct.
rtn = 0
do while .t.
if valtype(obtp)<>'N'.AND.obtp<>nil
rtn = -101
exit
elseif valtype(obnm)<>'C'.AND.obnm<>nil
rtn = -102
exit
elseif valtype(aobnm)<>'A'.AND.aobnm<>nil
rtn = -103
exit
elseif valtype(aobtp)<>'A'.AND.aobtp<>nil
rtn = -104
exit
endi
* Set up defaults
mobnm = if(obnm=nil,'*',alltrim(obnm))
rtn = BDOBSN( obtp, mobnm,.F.,@arobid,@arobtp,@arobnm) // SEGUE API
if rtn<0.or.empty(arobnm)
exit
endi
for i=1 to len(arobnm)
if arobid[i]=0.or.arobnm[i]=nil.or. empty(arobnm[i])
arobnm[i]=nil
arobid[i]=0
loop
endi
exitflag=.F.
asize(arprvl,0) // reset array size
rtn1 = BDPTVLRD(, arobid[i], pnam, @arprvl) // SEGUE API
if rtn1 < 0 .or. empty(arprvl) // check to see if it has a SECURITY_EQUALS property
arobnm[i]=nil
arobid[i]=0
asize(arprvl,0) // reset array size
loop
endi
// property values of SECURITY_EQUALS
for j=1 to len(arprvl)
mvalue = arprvl[j] // value string
for k=1 to 125 step 4
if dosl2bid(mvalue,k)<>1 // convert substring to object id
loop
endi
* If object has supervisor equivalence add name to passed array then delete from temp list.
if valtype(arobnm[i])='C'
aadd(aobnm, arobnm[i])
aadd(aobid, arobid[i])
aadd(aobtp, arobtp[i])
endi
arobnm[i]=nil
asize(arprvl,0) // reset array size
exitflag=.T.
EXIT
NEXT
If exitflag
exit
endi
NEXT
next
* THE FOLLOWING SCANS REMAINING OBJECTS TO SEE IF ANY HAVE SECURITY EQUALS SET TO
* ANOTHER USER WHO HAS SUPERVISOR EQUIVALENCES AND ADDS THEM TO THE LIST
* OF THOSE WITH SUPERVISOR EQUIVALENCES.
mpassbg=len(aobnm)
mpassen=mpassbg+1
do while mpassbg<>mpassen
mpassbg = mpassbg+1
for i=1 to len(aobnm) // for each name in the supervisors list
for j=1 to len(arobnm) // for each name in the list of users not in supervisors list
if arobnm[j]=nil
loop
endi
exitflag=.F.
asize(arprvl,0) // reset array size
rtn1 = BDPTVLRD(, arobid[j], pnam, @arprvl) // each property value SEGUE API
if rtn1 < 0 .or. empty(arprvl)// check to see if it has a SECURITY_EQUALS property
asize(arprvl,0) // reset array size
loop
endi // check to see if it has a SECURITY_EQUALS property [line: 119]
for k=1 to len(arprvl) // each segment is in an array
mvalue = arprvl[k]
for l=1 to 125 step 4 // for each segment value id (four bytes)
if dosl2bid(mvalue,l) <> aobid[i] // if not security equivalent, skip
loop
endi // if not security equivalent, skip
* Object has equivalence to object with supervisor equivalence, add name to passed array then delete from temp list.
if valtype(arobnm[j])='C'
aadd(aobnm, arobnm[j])
aadd(aobid, arobid[j])
aadd(aobtp, arobtp[j])
mpassen=mpassen+1
endi
arobnm[j] = nil
asize(arprvl,0) // reset array size
exitflag=.T.
EXIT
NEXT
if exitflag
EXIT
endi
NEXT // for each segment value id (four bytes)
NEXT
NEXT // each segment is in an array
exit
endd
EXIT
endd // for each name in the list of users not in supervisors list [line: 111]
RETURN rtn